<script type="text/javascript" src="./resources/js/jquery-3.4.1.min.js"></script>

<script>
    $(document).ready(function () {
        console.log("页面载入search时！");
        console.log("window.location.pathname:"+window.location.pathname);
        var pathname = window.location.pathname;
        if(pathname.includes("routes")){
            document.getElementById("routesLi").className = 'active';
        }else if(pathname.includes("spot")){
            document.getElementById("spotLi").className = 'active';
        }else if(pathname.includes("index")||pathname==="/"){
            document.getElementById("indexLi").className = 'active';
        }
    });
</script>
<div class="container" style="font-size: 20px; ">
    <div class="row">
        <div class="span6">
            <ul class="nav nav-pills">
                <li id="indexLi"><a href="./index.jsp">主页</a></li>
                <li id="spotLi"><a href="./spotList.jsp">景点</a></li>
                <li id="routesLi"><a href="./routesList.jsp">旅游线路</a></li>

                <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">推荐榜<b class="caret bottom-up"></b></a>
                    <ul class="dropdown-menu bottom-up pull-right">
                        <li><a href="./spotDetail.jsp?spotId=1">三坊七巷</a></li>
                        <li><a href="./spotDetail.jsp?spotId=7">福州云顶</a></li>
                        <li><a href="./spotDetail.jsp?spotId=3">福州西湖公园</a></li>
                    </ul>
                </li>


            </ul>
        </div>
    </div>
</div>
<div style="clear: both;"></div>